package com.example.demo.dao;

import com.example.demo.entity.Admin;
import com.example.demo.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository

public interface AdminDao extends Mapper<Admin> {


    List<Admin> findBySearch(@Param("params") Params params);

    @Select("select * from admin where name = #{name} limit 1")
    Admin findByName(@Param("name") String name);

    @Select("select * from admin where name = #{name} and password = #{password} limit 1")
    Admin findByNameAndPassword(@Param("name") String name,@Param("password") String password);


    //1.基础注解的方式
//    @Select("select * from user")
//    List<User> getUser();
    //2.


}
